home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 54
/
054.d81
/
vcr library
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
12KB
|
415 lines
20 rem poke788,52:rem disable run/stop
30 rem trasmart software
40 rem vcr library
50 gosub3830:goto620
60 rem --------------------------- bell
70 s=54272:pokes+1,112:pokes+5,10:pokes+6,9:pokes+24,15:pokes+4,17:pokes+4,16
80 return
90 rem ------------------ title screen
100 l=len(k$):m=38-l/2:fori=1tolen(k$)-19
110 printl$spc(m)left$(k$,i)right$(k$,l-(l-i)):m=m-1:next:return
120 rem ---------------------- directory
130 sys49152
140 print"[147] [158]q to quit [158]p to pause / resume"
150 open8,8,0,"$0:*=r"
160 get#8,a$,b$:n$=chr$(0)
170 get#8,a$,b$:ifb$=""then260
180 get#8,a$,b$:a=asc(a$+n$):b=asc(b$+n$)
190 c$=mid$(str$(a+256*b),2)+chr$(32)
200 print" ";
210 printc$;:get#8,c$:ifc$<>""then210
220 print:getk$:ifk$="p"ork$="q"then240
230 getk$
240 ifk$="p"thenwait197,1:goto230
250 ifk$<>"q"then170
260 close8
270 print"[156]press space to continue[146]"
280 s=54272:pokes+1,112:pokes+5,10:pokes+6,9:pokes+24,15:pokes+4,17:pokes+4,16
290 ifpeek(203)<>60then290
300 goto780
310 rem -------------------- input data
320 poke198,0:y$="":z$=""
330 print"[156]_[157][146]";
340 forn=1to75 :getz$:ifz$<>""then380
342 next
350 print"_[157]";
360 forn=1to75 :getz$:ifz$<>""then380
362 next
370 getz$:ifz$=""then330
380 l=len(y$)
390 ifz$=chr$(13)andre=1thenprint"[156][157] ":return
400 ifz$=chr$(13)thenprint"[157] ":return
410 ifz$=chr$(20)andlandre=1thenprint"[156] [157][157]";:y$=left$(y$,l-1):goto330
420 ifz$=chr$(20)andlthenprint" [157][157]";:y$=left$(y$,l-1):goto330
430 ifhl=2orhl=19thenif(z$<"a"orz$>"z")andz$<>" "and(z$<"0"orz$>"9")then330
440 ifhl=1orhl=3orhl=4thenif(z$<"0"orz$>"9")andz$<>" "then330
450 ifl>=hlthen330
460 ifre=1thenprint"[156]";z$;:y$=y$+z$:goto330
470 printz$;:y$=y$+z$
480 goto330
490 rem --------------------- error chk
500 input#15,e,e$,a,b
510 ife=0ore=73thenreturn
520 ife=50thenreturn
530 print"there is an i/o problem"
540 print"error # is";e;" ";e$
550 print"track";a;"; sector";b
560 close8:close15
570 print"[156]press space to continue[146][145][145]";
580 ifpeek(203)=64then580
590 ifpeek(203)<>60then580
600 goto780
610 close8:close15:end
620 rem ------------------------ start
630 h=0
640 sp$=" "
650 open15,8,15,"i0":close15
660 gosub3100
670 ll$=chr$(13)
680 ln=40
690 open15,8,15
700 gosub490
710 close8:close15
720 k$="[152][221] instructions (y/n) [221]":l$=l$+"":gosub100
730 poke198,0
740 ifpeek(203)=64then740
750 ifpeek(203)=39then780
760 ifpeek(203)=25thenis=1:gosub2760:goto780
770 goto730
780 sys49152
790 print"[147][156][213][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][201]";
800 print"[221] r[156]ead a tape";
810 print" w[156]rite a tape";
820 print" e[156]dit tape [221]";
830 print"[171][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][179]";
840 print"[221] p[156]rint label";
850 print" c[156]reate file";
860 print" d[156]irectory [221]";
870 print"[171][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][179]";
880 print"[221] h[156]elp screen";
890 print" s[156]ee all files";
900 print" l[156]oadstar [221]";
910 print"[202][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][203][146]";
920 poke198,0
930 geta$:ifa$=""ora$=" "then930
940 gosub70
950 ifa$=chr$(80)ora$=chr$(87)ora$=chr$(82)then1020
960 ifa$=chr$(67)ora$=chr$(69)then1020
970 ifa$=chr$(76)then2400:rem l
980 ifa$=chr$(68)then120:rem d
990 ifa$=chr$(83)then3230:rem s
1000 ifa$=chr$(72)thenh=1:goto2760:rem h
1010 goto780
1020 print"[145][156][171][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][179][146]"
1030 print"[145][156][221]what tape number to [221][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]"
1040 print"[156][202][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][203][146]"
1050 print"[145][145][145]"spc(21);
1060 ifa$=chr$(80)thenprint"print ";
1070 ifa$=chr$(87)thenprint"write ";
1080 ifa$=chr$(82)thenprint"read ";
1090 ifa$=chr$(67)thenprint"create ";
1100 ifa$=chr$(69)thenprint"edit ";
1110 ifa$<chr$(65)ora$>chr$(90)then790
1120 re=1:hl=3:gosub320:v$=y$:re=0
1130 gosub70
1140 ifval(v$)<1thenprint"file # must be greater than 0"
1150 ifval(v$)>200thenprint"file # must be less than 200"
1160 ifval(v$)<1orval(v$)>200thenprint"[156]press space to continue[146]"
1170 ifval(v$)<1orval(v$)>200thenwait197,4:a$="":goto780
1180 vw=0
1190 ifa$=chr$(80)then2470:rem p
1200 ifa$=chr$(82)then1260:rem r
1210 ifa$=chr$(87)then1550:rem w
1220 ifa$=chr$(67)then1780:rem c
1230 ifa$=chr$(69)then1950:rem e
1240 goto780
1250 :
1260 rem -------------------------- read
1270 open15,8,15
1280 gosub490
1285 print#15,"r0:"+v$+"="+v$:input#15,er
1286 if er<>63 then printspc(13)"file is empty [156]":rn=8:goto1450
1290 open8,8,8,"0:"+(v$)+",l,"+chr$(ln)
1300 gosub490
1310 rn=1
1320 rem return here for line 2 - 7
1330 gosub2460
1340 print#15,"p"+chr$(96+8)+chr$(rl)+chr$(rh)+chr$(1)
1350 gosub490
1360 input#8,aa$,bb$,cc$,dd$,ee$
1370 gosub490
1380 ifaa$="[255]"andrn=1thenprintspc(13)"file is empty [156]":rn=8:goto1450
1390 ifaa$="[255]"thenrn=8:goto1450
1400 ifcc$=""thencc$=" deleted[152]"
1410 ifrn=1thenprint"[156][221] tape number ";v$;" contains "
1420 ifrn=1thenprint"[156][202][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][203][146]";
1430 ifrn=1thenprint" title rated from to[152]"
1440 printaa$+". "tab(3)cc$tab(23)bb$tab(28)dd$tab(33)ee$
1450 ifrn>=8andvw=1thenclose8:close15:return
1460 ifrn>=8thenprint"[156]press space to continue[146]"
1470 ifrn>=8thenclose8:close15
1480 ifrn>=8thengosub70
1490 ifrn>=8thenifpeek(203)<>60then1490
1500 ifrn>=8then1530
1510 rn=rn+1
1520 goto1320
1530 goto780
1540 :
1550 rem ------------------------ write
1560 open15,8,15
1570 gosub490
1580 open8,8,8,"0:"+(v$)+",l,"+chr$(ln)
1590 gosub490
1600 print"ready to write tape #";v$
1610 print"line# (1 chr max) ";:hl=1:gosub320:aa$=y$
1620 ifaa$=""thenprint"cancelled":forpa=1to800:nextpa:goto1760
1630 rn=val(aa$)
1640 ifrn>=8thenclose8:close15:goto780
1650 print"rated (2 chr max) ";:hl=2:gosub320:bb$=y$
1660 print"title (19 chr max) ";:hl=19:gosub320:cc$=y$
1670 print"from (4 chr max) ";:hl=4:gosub320:dd$=y$
1680 print"to (4 chr max) ";:hl=4:gosub320:ee$=y$
1690 rc$=aa$+ll$+bb$+ll$+cc$+ll$+dd$+ll$+ee$
1700 gosub2460
1710 print#15,"p"+chr$(96+8)+chr$(rl)+chr$(rh)+chr$(1)
1720 gosub490
1730 if e=50 thenprint"the dos will expand the file now"
1740 print#8,rc$
1750 gosub490
1760 close8:close15:goto780
1770 :
1780 rem ------------------ create file
1790 print""
1800 print"setting up file...wait one moment"
1810 open15,8,15,"ui"
1820 gosub490
1830 open8,8,8,"0:"+(v$)+",l,"+chr$(ln)
1840 gosub490
1850 print""
1860 rn=7
1870 gosub2460
1880 print#15,"p"+chr$(96+8)+chr$(rl)+chr$(rh)+chr$(1)
1890 gosub490
1900 if e<>50thenprint"file "v$" exists"
1910 if e=50 thenprint"writing blank file to disk now"
1920 print#8,chr$(255)
1930 gosub490
1940 close8:close15:goto780
1950 rem ------------------------- edit
1960 vw=1:gosub1260:vw=0
1970 open15,8,15
1980 gosub490
1990 open8,8,8,"0:"+(v$)+",